/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
import * as $protobuf from "protobufjs/minimal.js";
import Long from 'long';
$protobuf.default.util.Long = Long;
$protobuf.default.configure();

const $Reader = $protobuf.default.Reader, $Writer = $protobuf.default.Writer, $util = $protobuf.default.util;

const $root = {};

export const Game = $root.Game = (() => {

    const Game = {};

    Game.p_login_info = (function() {

        function p_login_info(p) {
            this.extraInfo = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        p_login_info.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        p_login_info.prototype.name = "";
        p_login_info.prototype.sex = 0;
        p_login_info.prototype.level = 0;
        p_login_info.prototype.lastLoginTime = 0;
        p_login_info.prototype.identity = 0;
        p_login_info.prototype.createTime = 0;
        p_login_info.prototype.extraInfo = $util.emptyArray;

        p_login_info.create = function create(properties) {
            return new p_login_info(properties);
        };

        p_login_info.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.id != null && Object.hasOwnProperty.call(m, "id"))
                w.uint32(8).uint64(m.id);
            if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                w.uint32(18).string(m.name);
            if (m.sex != null && Object.hasOwnProperty.call(m, "sex"))
                w.uint32(24).uint32(m.sex);
            if (m.level != null && Object.hasOwnProperty.call(m, "level"))
                w.uint32(32).uint32(m.level);
            if (m.lastLoginTime != null && Object.hasOwnProperty.call(m, "lastLoginTime"))
                w.uint32(40).uint32(m.lastLoginTime);
            if (m.identity != null && Object.hasOwnProperty.call(m, "identity"))
                w.uint32(48).uint32(m.identity);
            if (m.createTime != null && Object.hasOwnProperty.call(m, "createTime"))
                w.uint32(56).uint32(m.createTime);
            if (m.extraInfo != null && m.extraInfo.length) {
                for (var i = 0; i < m.extraInfo.length; ++i)
                    $root.Game.p_key_value_name.encode(m.extraInfo[i], w.uint32(66).fork()).ldelim();
            }
            return w;
        };

        p_login_info.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.p_login_info();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.id = r.uint64();
                    break;
                case 2:
                    m.name = r.string();
                    break;
                case 3:
                    m.sex = r.uint32();
                    break;
                case 4:
                    m.level = r.uint32();
                    break;
                case 5:
                    m.lastLoginTime = r.uint32();
                    break;
                case 6:
                    m.identity = r.uint32();
                    break;
                case 7:
                    m.createTime = r.uint32();
                    break;
                case 8:
                    if (!(m.extraInfo && m.extraInfo.length))
                        m.extraInfo = [];
                    m.extraInfo.push($root.Game.p_key_value_name.decode(r, r.uint32()));
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        p_login_info.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.p_login_info)
                return d;
            var m = new $root.Game.p_login_info();
            if (d.id != null) {
                if ($util.Long)
                    (m.id = $util.Long.fromValue(d.id)).unsigned = true;
                else if (typeof d.id === "string")
                    m.id = parseInt(d.id, 10);
                else if (typeof d.id === "number")
                    m.id = d.id;
                else if (typeof d.id === "object")
                    m.id = new $util.LongBits(d.id.low >>> 0, d.id.high >>> 0).toNumber(true);
            }
            if (d.name != null) {
                m.name = String(d.name);
            }
            if (d.sex != null) {
                m.sex = d.sex >>> 0;
            }
            if (d.level != null) {
                m.level = d.level >>> 0;
            }
            if (d.lastLoginTime != null) {
                m.lastLoginTime = d.lastLoginTime >>> 0;
            }
            if (d.identity != null) {
                m.identity = d.identity >>> 0;
            }
            if (d.createTime != null) {
                m.createTime = d.createTime >>> 0;
            }
            if (d.extraInfo) {
                if (!Array.isArray(d.extraInfo))
                    throw TypeError(".Game.p_login_info.extraInfo: array expected");
                m.extraInfo = [];
                for (var i = 0; i < d.extraInfo.length; ++i) {
                    if (typeof d.extraInfo[i] !== "object")
                        throw TypeError(".Game.p_login_info.extraInfo: object expected");
                    m.extraInfo[i] = $root.Game.p_key_value_name.fromObject(d.extraInfo[i]);
                }
            }
            return m;
        };

        p_login_info.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.extraInfo = [];
            }
            if (o.defaults) {
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.id = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.id = o.longs === String ? "0" : 0;
                d.name = "";
                d.sex = 0;
                d.level = 0;
                d.lastLoginTime = 0;
                d.identity = 0;
                d.createTime = 0;
            }
            if (m.id != null && m.hasOwnProperty("id")) {
                if (typeof m.id === "number")
                    d.id = o.longs === String ? String(m.id) : m.id;
                else
                    d.id = o.longs === String ? $util.Long.prototype.toString.call(m.id) : o.longs === Number ? new $util.LongBits(m.id.low >>> 0, m.id.high >>> 0).toNumber(true) : m.id;
            }
            if (m.name != null && m.hasOwnProperty("name")) {
                d.name = m.name;
            }
            if (m.sex != null && m.hasOwnProperty("sex")) {
                d.sex = m.sex;
            }
            if (m.level != null && m.hasOwnProperty("level")) {
                d.level = m.level;
            }
            if (m.lastLoginTime != null && m.hasOwnProperty("lastLoginTime")) {
                d.lastLoginTime = m.lastLoginTime;
            }
            if (m.identity != null && m.hasOwnProperty("identity")) {
                d.identity = m.identity;
            }
            if (m.createTime != null && m.hasOwnProperty("createTime")) {
                d.createTime = m.createTime;
            }
            if (m.extraInfo && m.extraInfo.length) {
                d.extraInfo = [];
                for (var j = 0; j < m.extraInfo.length; ++j) {
                    d.extraInfo[j] = $root.Game.p_key_value_name.toObject(m.extraInfo[j], o);
                }
            }
            return d;
        };

        p_login_info.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return p_login_info;
    })();

    Game.p_client_info = (function() {

        function p_client_info(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        p_client_info.prototype.did = "";
        p_client_info.prototype.gameVersion = "";
        p_client_info.prototype.os = "";
        p_client_info.prototype.osVer = "";
        p_client_info.prototype.device = "";
        p_client_info.prototype.deviceType = "";
        p_client_info.prototype.screen = "";
        p_client_info.prototype.mno = "";
        p_client_info.prototype.nm = "";
        p_client_info.prototype.platform = "";
        p_client_info.prototype.gameid = "";
        p_client_info.prototype.channel = "";
        p_client_info.prototype.bigVersion = "";
        p_client_info.prototype.packageName = "";
        p_client_info.prototype.regIp = "";
        p_client_info.prototype.logDevice = "";
        p_client_info.prototype.ext = "";

        p_client_info.create = function create(properties) {
            return new p_client_info(properties);
        };

        p_client_info.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.did != null && Object.hasOwnProperty.call(m, "did"))
                w.uint32(10).string(m.did);
            if (m.gameVersion != null && Object.hasOwnProperty.call(m, "gameVersion"))
                w.uint32(18).string(m.gameVersion);
            if (m.os != null && Object.hasOwnProperty.call(m, "os"))
                w.uint32(26).string(m.os);
            if (m.osVer != null && Object.hasOwnProperty.call(m, "osVer"))
                w.uint32(34).string(m.osVer);
            if (m.device != null && Object.hasOwnProperty.call(m, "device"))
                w.uint32(42).string(m.device);
            if (m.deviceType != null && Object.hasOwnProperty.call(m, "deviceType"))
                w.uint32(50).string(m.deviceType);
            if (m.screen != null && Object.hasOwnProperty.call(m, "screen"))
                w.uint32(58).string(m.screen);
            if (m.mno != null && Object.hasOwnProperty.call(m, "mno"))
                w.uint32(66).string(m.mno);
            if (m.nm != null && Object.hasOwnProperty.call(m, "nm"))
                w.uint32(74).string(m.nm);
            if (m.platform != null && Object.hasOwnProperty.call(m, "platform"))
                w.uint32(82).string(m.platform);
            if (m.gameid != null && Object.hasOwnProperty.call(m, "gameid"))
                w.uint32(90).string(m.gameid);
            if (m.channel != null && Object.hasOwnProperty.call(m, "channel"))
                w.uint32(98).string(m.channel);
            if (m.bigVersion != null && Object.hasOwnProperty.call(m, "bigVersion"))
                w.uint32(106).string(m.bigVersion);
            if (m.packageName != null && Object.hasOwnProperty.call(m, "packageName"))
                w.uint32(114).string(m.packageName);
            if (m.regIp != null && Object.hasOwnProperty.call(m, "regIp"))
                w.uint32(122).string(m.regIp);
            if (m.logDevice != null && Object.hasOwnProperty.call(m, "logDevice"))
                w.uint32(130).string(m.logDevice);
            if (m.ext != null && Object.hasOwnProperty.call(m, "ext"))
                w.uint32(138).string(m.ext);
            return w;
        };

        p_client_info.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.p_client_info();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.did = r.string();
                    break;
                case 2:
                    m.gameVersion = r.string();
                    break;
                case 3:
                    m.os = r.string();
                    break;
                case 4:
                    m.osVer = r.string();
                    break;
                case 5:
                    m.device = r.string();
                    break;
                case 6:
                    m.deviceType = r.string();
                    break;
                case 7:
                    m.screen = r.string();
                    break;
                case 8:
                    m.mno = r.string();
                    break;
                case 9:
                    m.nm = r.string();
                    break;
                case 10:
                    m.platform = r.string();
                    break;
                case 11:
                    m.gameid = r.string();
                    break;
                case 12:
                    m.channel = r.string();
                    break;
                case 13:
                    m.bigVersion = r.string();
                    break;
                case 14:
                    m.packageName = r.string();
                    break;
                case 15:
                    m.regIp = r.string();
                    break;
                case 16:
                    m.logDevice = r.string();
                    break;
                case 17:
                    m.ext = r.string();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        p_client_info.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.p_client_info)
                return d;
            var m = new $root.Game.p_client_info();
            if (d.did != null) {
                m.did = String(d.did);
            }
            if (d.gameVersion != null) {
                m.gameVersion = String(d.gameVersion);
            }
            if (d.os != null) {
                m.os = String(d.os);
            }
            if (d.osVer != null) {
                m.osVer = String(d.osVer);
            }
            if (d.device != null) {
                m.device = String(d.device);
            }
            if (d.deviceType != null) {
                m.deviceType = String(d.deviceType);
            }
            if (d.screen != null) {
                m.screen = String(d.screen);
            }
            if (d.mno != null) {
                m.mno = String(d.mno);
            }
            if (d.nm != null) {
                m.nm = String(d.nm);
            }
            if (d.platform != null) {
                m.platform = String(d.platform);
            }
            if (d.gameid != null) {
                m.gameid = String(d.gameid);
            }
            if (d.channel != null) {
                m.channel = String(d.channel);
            }
            if (d.bigVersion != null) {
                m.bigVersion = String(d.bigVersion);
            }
            if (d.packageName != null) {
                m.packageName = String(d.packageName);
            }
            if (d.regIp != null) {
                m.regIp = String(d.regIp);
            }
            if (d.logDevice != null) {
                m.logDevice = String(d.logDevice);
            }
            if (d.ext != null) {
                m.ext = String(d.ext);
            }
            return m;
        };

        p_client_info.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.did = "";
                d.gameVersion = "";
                d.os = "";
                d.osVer = "";
                d.device = "";
                d.deviceType = "";
                d.screen = "";
                d.mno = "";
                d.nm = "";
                d.platform = "";
                d.gameid = "";
                d.channel = "";
                d.bigVersion = "";
                d.packageName = "";
                d.regIp = "";
                d.logDevice = "";
                d.ext = "";
            }
            if (m.did != null && m.hasOwnProperty("did")) {
                d.did = m.did;
            }
            if (m.gameVersion != null && m.hasOwnProperty("gameVersion")) {
                d.gameVersion = m.gameVersion;
            }
            if (m.os != null && m.hasOwnProperty("os")) {
                d.os = m.os;
            }
            if (m.osVer != null && m.hasOwnProperty("osVer")) {
                d.osVer = m.osVer;
            }
            if (m.device != null && m.hasOwnProperty("device")) {
                d.device = m.device;
            }
            if (m.deviceType != null && m.hasOwnProperty("deviceType")) {
                d.deviceType = m.deviceType;
            }
            if (m.screen != null && m.hasOwnProperty("screen")) {
                d.screen = m.screen;
            }
            if (m.mno != null && m.hasOwnProperty("mno")) {
                d.mno = m.mno;
            }
            if (m.nm != null && m.hasOwnProperty("nm")) {
                d.nm = m.nm;
            }
            if (m.platform != null && m.hasOwnProperty("platform")) {
                d.platform = m.platform;
            }
            if (m.gameid != null && m.hasOwnProperty("gameid")) {
                d.gameid = m.gameid;
            }
            if (m.channel != null && m.hasOwnProperty("channel")) {
                d.channel = m.channel;
            }
            if (m.bigVersion != null && m.hasOwnProperty("bigVersion")) {
                d.bigVersion = m.bigVersion;
            }
            if (m.packageName != null && m.hasOwnProperty("packageName")) {
                d.packageName = m.packageName;
            }
            if (m.regIp != null && m.hasOwnProperty("regIp")) {
                d.regIp = m.regIp;
            }
            if (m.logDevice != null && m.hasOwnProperty("logDevice")) {
                d.logDevice = m.logDevice;
            }
            if (m.ext != null && m.hasOwnProperty("ext")) {
                d.ext = m.ext;
            }
            return d;
        };

        p_client_info.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return p_client_info;
    })();

    Game.login_heart_c2s = (function() {

        function login_heart_c2s(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_heart_c2s.prototype.index = 0;
        login_heart_c2s.prototype.clientTime = 0;
        login_heart_c2s.prototype.serverTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        login_heart_c2s.create = function create(properties) {
            return new login_heart_c2s(properties);
        };

        login_heart_c2s.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                w.uint32(8).uint32(m.index);
            if (m.clientTime != null && Object.hasOwnProperty.call(m, "clientTime"))
                w.uint32(16).uint32(m.clientTime);
            if (m.serverTime != null && Object.hasOwnProperty.call(m, "serverTime"))
                w.uint32(24).uint64(m.serverTime);
            return w;
        };

        login_heart_c2s.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_heart_c2s();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.index = r.uint32();
                    break;
                case 2:
                    m.clientTime = r.uint32();
                    break;
                case 3:
                    m.serverTime = r.uint64();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_heart_c2s.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_heart_c2s)
                return d;
            var m = new $root.Game.login_heart_c2s();
            if (d.index != null) {
                m.index = d.index >>> 0;
            }
            if (d.clientTime != null) {
                m.clientTime = d.clientTime >>> 0;
            }
            if (d.serverTime != null) {
                if ($util.Long)
                    (m.serverTime = $util.Long.fromValue(d.serverTime)).unsigned = true;
                else if (typeof d.serverTime === "string")
                    m.serverTime = parseInt(d.serverTime, 10);
                else if (typeof d.serverTime === "number")
                    m.serverTime = d.serverTime;
                else if (typeof d.serverTime === "object")
                    m.serverTime = new $util.LongBits(d.serverTime.low >>> 0, d.serverTime.high >>> 0).toNumber(true);
            }
            return m;
        };

        login_heart_c2s.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.index = 0;
                d.clientTime = 0;
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.serverTime = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.serverTime = o.longs === String ? "0" : 0;
            }
            if (m.index != null && m.hasOwnProperty("index")) {
                d.index = m.index;
            }
            if (m.clientTime != null && m.hasOwnProperty("clientTime")) {
                d.clientTime = m.clientTime;
            }
            if (m.serverTime != null && m.hasOwnProperty("serverTime")) {
                if (typeof m.serverTime === "number")
                    d.serverTime = o.longs === String ? String(m.serverTime) : m.serverTime;
                else
                    d.serverTime = o.longs === String ? $util.Long.prototype.toString.call(m.serverTime) : o.longs === Number ? new $util.LongBits(m.serverTime.low >>> 0, m.serverTime.high >>> 0).toNumber(true) : m.serverTime;
            }
            return d;
        };

        login_heart_c2s.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_heart_c2s;
    })();

    Game.login_heart_s2c = (function() {

        function login_heart_s2c(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_heart_s2c.prototype.index = 0;
        login_heart_s2c.prototype.serverTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        login_heart_s2c.prototype.runTime = 0;

        login_heart_s2c.create = function create(properties) {
            return new login_heart_s2c(properties);
        };

        login_heart_s2c.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.index != null && Object.hasOwnProperty.call(m, "index"))
                w.uint32(8).uint32(m.index);
            if (m.serverTime != null && Object.hasOwnProperty.call(m, "serverTime"))
                w.uint32(16).uint64(m.serverTime);
            if (m.runTime != null && Object.hasOwnProperty.call(m, "runTime"))
                w.uint32(24).uint32(m.runTime);
            return w;
        };

        login_heart_s2c.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_heart_s2c();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.index = r.uint32();
                    break;
                case 2:
                    m.serverTime = r.uint64();
                    break;
                case 3:
                    m.runTime = r.uint32();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_heart_s2c.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_heart_s2c)
                return d;
            var m = new $root.Game.login_heart_s2c();
            if (d.index != null) {
                m.index = d.index >>> 0;
            }
            if (d.serverTime != null) {
                if ($util.Long)
                    (m.serverTime = $util.Long.fromValue(d.serverTime)).unsigned = true;
                else if (typeof d.serverTime === "string")
                    m.serverTime = parseInt(d.serverTime, 10);
                else if (typeof d.serverTime === "number")
                    m.serverTime = d.serverTime;
                else if (typeof d.serverTime === "object")
                    m.serverTime = new $util.LongBits(d.serverTime.low >>> 0, d.serverTime.high >>> 0).toNumber(true);
            }
            if (d.runTime != null) {
                m.runTime = d.runTime >>> 0;
            }
            return m;
        };

        login_heart_s2c.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.index = 0;
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.serverTime = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.serverTime = o.longs === String ? "0" : 0;
                d.runTime = 0;
            }
            if (m.index != null && m.hasOwnProperty("index")) {
                d.index = m.index;
            }
            if (m.serverTime != null && m.hasOwnProperty("serverTime")) {
                if (typeof m.serverTime === "number")
                    d.serverTime = o.longs === String ? String(m.serverTime) : m.serverTime;
                else
                    d.serverTime = o.longs === String ? $util.Long.prototype.toString.call(m.serverTime) : o.longs === Number ? new $util.LongBits(m.serverTime.low >>> 0, m.serverTime.high >>> 0).toNumber(true) : m.serverTime;
            }
            if (m.runTime != null && m.hasOwnProperty("runTime")) {
                d.runTime = m.runTime;
            }
            return d;
        };

        login_heart_s2c.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_heart_s2c;
    })();

    Game.login_auth_c2s = (function() {

        function login_auth_c2s(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_auth_c2s.prototype.uid = "";
        login_auth_c2s.prototype.uname = "";
        login_auth_c2s.prototype.pKey = "";
        login_auth_c2s.prototype.time = 0;
        login_auth_c2s.prototype.token = "";
        login_auth_c2s.prototype.clientInfo = null;

        login_auth_c2s.create = function create(properties) {
            return new login_auth_c2s(properties);
        };

        login_auth_c2s.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.uid != null && Object.hasOwnProperty.call(m, "uid"))
                w.uint32(10).string(m.uid);
            if (m.uname != null && Object.hasOwnProperty.call(m, "uname"))
                w.uint32(18).string(m.uname);
            if (m.pKey != null && Object.hasOwnProperty.call(m, "pKey"))
                w.uint32(26).string(m.pKey);
            if (m.time != null && Object.hasOwnProperty.call(m, "time"))
                w.uint32(32).uint32(m.time);
            if (m.token != null && Object.hasOwnProperty.call(m, "token"))
                w.uint32(42).string(m.token);
            if (m.clientInfo != null && Object.hasOwnProperty.call(m, "clientInfo"))
                $root.Game.p_client_info.encode(m.clientInfo, w.uint32(50).fork()).ldelim();
            return w;
        };

        login_auth_c2s.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_auth_c2s();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.uid = r.string();
                    break;
                case 2:
                    m.uname = r.string();
                    break;
                case 3:
                    m.pKey = r.string();
                    break;
                case 4:
                    m.time = r.uint32();
                    break;
                case 5:
                    m.token = r.string();
                    break;
                case 6:
                    m.clientInfo = $root.Game.p_client_info.decode(r, r.uint32());
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_auth_c2s.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_auth_c2s)
                return d;
            var m = new $root.Game.login_auth_c2s();
            if (d.uid != null) {
                m.uid = String(d.uid);
            }
            if (d.uname != null) {
                m.uname = String(d.uname);
            }
            if (d.pKey != null) {
                m.pKey = String(d.pKey);
            }
            if (d.time != null) {
                m.time = d.time >>> 0;
            }
            if (d.token != null) {
                m.token = String(d.token);
            }
            if (d.clientInfo != null) {
                if (typeof d.clientInfo !== "object")
                    throw TypeError(".Game.login_auth_c2s.clientInfo: object expected");
                m.clientInfo = $root.Game.p_client_info.fromObject(d.clientInfo);
            }
            return m;
        };

        login_auth_c2s.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.uid = "";
                d.uname = "";
                d.pKey = "";
                d.time = 0;
                d.token = "";
                d.clientInfo = null;
            }
            if (m.uid != null && m.hasOwnProperty("uid")) {
                d.uid = m.uid;
            }
            if (m.uname != null && m.hasOwnProperty("uname")) {
                d.uname = m.uname;
            }
            if (m.pKey != null && m.hasOwnProperty("pKey")) {
                d.pKey = m.pKey;
            }
            if (m.time != null && m.hasOwnProperty("time")) {
                d.time = m.time;
            }
            if (m.token != null && m.hasOwnProperty("token")) {
                d.token = m.token;
            }
            if (m.clientInfo != null && m.hasOwnProperty("clientInfo")) {
                d.clientInfo = $root.Game.p_client_info.toObject(m.clientInfo, o);
            }
            return d;
        };

        login_auth_c2s.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_auth_c2s;
    })();

    Game.login_auth_s2c = (function() {

        function login_auth_s2c(p) {
            this.roleList = [];
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_auth_s2c.prototype.code = 0;
        login_auth_s2c.prototype.timeZone = 0;
        login_auth_s2c.prototype.servId = 0;
        login_auth_s2c.prototype.roleList = $util.emptyArray;
        login_auth_s2c.prototype.platform = "";
        login_auth_s2c.prototype.serverTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        login_auth_s2c.create = function create(properties) {
            return new login_auth_s2c(properties);
        };

        login_auth_s2c.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.code != null && Object.hasOwnProperty.call(m, "code"))
                w.uint32(8).uint32(m.code);
            if (m.timeZone != null && Object.hasOwnProperty.call(m, "timeZone"))
                w.uint32(16).int32(m.timeZone);
            if (m.servId != null && Object.hasOwnProperty.call(m, "servId"))
                w.uint32(24).uint32(m.servId);
            if (m.roleList != null && m.roleList.length) {
                for (var i = 0; i < m.roleList.length; ++i)
                    $root.Game.p_login_info.encode(m.roleList[i], w.uint32(34).fork()).ldelim();
            }
            if (m.platform != null && Object.hasOwnProperty.call(m, "platform"))
                w.uint32(42).string(m.platform);
            if (m.serverTime != null && Object.hasOwnProperty.call(m, "serverTime"))
                w.uint32(48).uint64(m.serverTime);
            return w;
        };

        login_auth_s2c.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_auth_s2c();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.code = r.uint32();
                    break;
                case 2:
                    m.timeZone = r.int32();
                    break;
                case 3:
                    m.servId = r.uint32();
                    break;
                case 4:
                    if (!(m.roleList && m.roleList.length))
                        m.roleList = [];
                    m.roleList.push($root.Game.p_login_info.decode(r, r.uint32()));
                    break;
                case 5:
                    m.platform = r.string();
                    break;
                case 6:
                    m.serverTime = r.uint64();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_auth_s2c.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_auth_s2c)
                return d;
            var m = new $root.Game.login_auth_s2c();
            if (d.code != null) {
                m.code = d.code >>> 0;
            }
            if (d.timeZone != null) {
                m.timeZone = d.timeZone | 0;
            }
            if (d.servId != null) {
                m.servId = d.servId >>> 0;
            }
            if (d.roleList) {
                if (!Array.isArray(d.roleList))
                    throw TypeError(".Game.login_auth_s2c.roleList: array expected");
                m.roleList = [];
                for (var i = 0; i < d.roleList.length; ++i) {
                    if (typeof d.roleList[i] !== "object")
                        throw TypeError(".Game.login_auth_s2c.roleList: object expected");
                    m.roleList[i] = $root.Game.p_login_info.fromObject(d.roleList[i]);
                }
            }
            if (d.platform != null) {
                m.platform = String(d.platform);
            }
            if (d.serverTime != null) {
                if ($util.Long)
                    (m.serverTime = $util.Long.fromValue(d.serverTime)).unsigned = true;
                else if (typeof d.serverTime === "string")
                    m.serverTime = parseInt(d.serverTime, 10);
                else if (typeof d.serverTime === "number")
                    m.serverTime = d.serverTime;
                else if (typeof d.serverTime === "object")
                    m.serverTime = new $util.LongBits(d.serverTime.low >>> 0, d.serverTime.high >>> 0).toNumber(true);
            }
            return m;
        };

        login_auth_s2c.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.arrays || o.defaults) {
                d.roleList = [];
            }
            if (o.defaults) {
                d.code = 0;
                d.timeZone = 0;
                d.servId = 0;
                d.platform = "";
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.serverTime = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.serverTime = o.longs === String ? "0" : 0;
            }
            if (m.code != null && m.hasOwnProperty("code")) {
                d.code = m.code;
            }
            if (m.timeZone != null && m.hasOwnProperty("timeZone")) {
                d.timeZone = m.timeZone;
            }
            if (m.servId != null && m.hasOwnProperty("servId")) {
                d.servId = m.servId;
            }
            if (m.roleList && m.roleList.length) {
                d.roleList = [];
                for (var j = 0; j < m.roleList.length; ++j) {
                    d.roleList[j] = $root.Game.p_login_info.toObject(m.roleList[j], o);
                }
            }
            if (m.platform != null && m.hasOwnProperty("platform")) {
                d.platform = m.platform;
            }
            if (m.serverTime != null && m.hasOwnProperty("serverTime")) {
                if (typeof m.serverTime === "number")
                    d.serverTime = o.longs === String ? String(m.serverTime) : m.serverTime;
                else
                    d.serverTime = o.longs === String ? $util.Long.prototype.toString.call(m.serverTime) : o.longs === Number ? new $util.LongBits(m.serverTime.low >>> 0, m.serverTime.high >>> 0).toNumber(true) : m.serverTime;
            }
            return d;
        };

        login_auth_s2c.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_auth_s2c;
    })();

    Game.login_create_role_c2s = (function() {

        function login_create_role_c2s(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_create_role_c2s.prototype.nickName = "";

        login_create_role_c2s.create = function create(properties) {
            return new login_create_role_c2s(properties);
        };

        login_create_role_c2s.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.nickName != null && Object.hasOwnProperty.call(m, "nickName"))
                w.uint32(10).string(m.nickName);
            return w;
        };

        login_create_role_c2s.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_create_role_c2s();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.nickName = r.string();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_create_role_c2s.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_create_role_c2s)
                return d;
            var m = new $root.Game.login_create_role_c2s();
            if (d.nickName != null) {
                m.nickName = String(d.nickName);
            }
            return m;
        };

        login_create_role_c2s.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.nickName = "";
            }
            if (m.nickName != null && m.hasOwnProperty("nickName")) {
                d.nickName = m.nickName;
            }
            return d;
        };

        login_create_role_c2s.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_create_role_c2s;
    })();

    Game.login_create_role_s2c = (function() {

        function login_create_role_s2c(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_create_role_s2c.prototype.roleId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        login_create_role_s2c.prototype.code = 0;

        login_create_role_s2c.create = function create(properties) {
            return new login_create_role_s2c(properties);
        };

        login_create_role_s2c.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.roleId != null && Object.hasOwnProperty.call(m, "roleId"))
                w.uint32(8).uint64(m.roleId);
            if (m.code != null && Object.hasOwnProperty.call(m, "code"))
                w.uint32(16).uint32(m.code);
            return w;
        };

        login_create_role_s2c.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_create_role_s2c();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.roleId = r.uint64();
                    break;
                case 2:
                    m.code = r.uint32();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_create_role_s2c.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_create_role_s2c)
                return d;
            var m = new $root.Game.login_create_role_s2c();
            if (d.roleId != null) {
                if ($util.Long)
                    (m.roleId = $util.Long.fromValue(d.roleId)).unsigned = true;
                else if (typeof d.roleId === "string")
                    m.roleId = parseInt(d.roleId, 10);
                else if (typeof d.roleId === "number")
                    m.roleId = d.roleId;
                else if (typeof d.roleId === "object")
                    m.roleId = new $util.LongBits(d.roleId.low >>> 0, d.roleId.high >>> 0).toNumber(true);
            }
            if (d.code != null) {
                m.code = d.code >>> 0;
            }
            return m;
        };

        login_create_role_s2c.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.roleId = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.roleId = o.longs === String ? "0" : 0;
                d.code = 0;
            }
            if (m.roleId != null && m.hasOwnProperty("roleId")) {
                if (typeof m.roleId === "number")
                    d.roleId = o.longs === String ? String(m.roleId) : m.roleId;
                else
                    d.roleId = o.longs === String ? $util.Long.prototype.toString.call(m.roleId) : o.longs === Number ? new $util.LongBits(m.roleId.low >>> 0, m.roleId.high >>> 0).toNumber(true) : m.roleId;
            }
            if (m.code != null && m.hasOwnProperty("code")) {
                d.code = m.code;
            }
            return d;
        };

        login_create_role_s2c.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_create_role_s2c;
    })();

    Game.login_choose_role_c2s = (function() {

        function login_choose_role_c2s(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_choose_role_c2s.prototype.roleId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;

        login_choose_role_c2s.create = function create(properties) {
            return new login_choose_role_c2s(properties);
        };

        login_choose_role_c2s.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.roleId != null && Object.hasOwnProperty.call(m, "roleId"))
                w.uint32(8).uint64(m.roleId);
            return w;
        };

        login_choose_role_c2s.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_choose_role_c2s();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.roleId = r.uint64();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_choose_role_c2s.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_choose_role_c2s)
                return d;
            var m = new $root.Game.login_choose_role_c2s();
            if (d.roleId != null) {
                if ($util.Long)
                    (m.roleId = $util.Long.fromValue(d.roleId)).unsigned = true;
                else if (typeof d.roleId === "string")
                    m.roleId = parseInt(d.roleId, 10);
                else if (typeof d.roleId === "number")
                    m.roleId = d.roleId;
                else if (typeof d.roleId === "object")
                    m.roleId = new $util.LongBits(d.roleId.low >>> 0, d.roleId.high >>> 0).toNumber(true);
            }
            return m;
        };

        login_choose_role_c2s.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.roleId = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.roleId = o.longs === String ? "0" : 0;
            }
            if (m.roleId != null && m.hasOwnProperty("roleId")) {
                if (typeof m.roleId === "number")
                    d.roleId = o.longs === String ? String(m.roleId) : m.roleId;
                else
                    d.roleId = o.longs === String ? $util.Long.prototype.toString.call(m.roleId) : o.longs === Number ? new $util.LongBits(m.roleId.low >>> 0, m.roleId.high >>> 0).toNumber(true) : m.roleId;
            }
            return d;
        };

        login_choose_role_c2s.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_choose_role_c2s;
    })();

    Game.login_choose_role_s2c = (function() {

        function login_choose_role_s2c(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        login_choose_role_s2c.prototype.roleId = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
        login_choose_role_s2c.prototype.code = 0;

        login_choose_role_s2c.create = function create(properties) {
            return new login_choose_role_s2c(properties);
        };

        login_choose_role_s2c.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.roleId != null && Object.hasOwnProperty.call(m, "roleId"))
                w.uint32(8).uint64(m.roleId);
            if (m.code != null && Object.hasOwnProperty.call(m, "code"))
                w.uint32(16).uint32(m.code);
            return w;
        };

        login_choose_role_s2c.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.login_choose_role_s2c();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.roleId = r.uint64();
                    break;
                case 2:
                    m.code = r.uint32();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        login_choose_role_s2c.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.login_choose_role_s2c)
                return d;
            var m = new $root.Game.login_choose_role_s2c();
            if (d.roleId != null) {
                if ($util.Long)
                    (m.roleId = $util.Long.fromValue(d.roleId)).unsigned = true;
                else if (typeof d.roleId === "string")
                    m.roleId = parseInt(d.roleId, 10);
                else if (typeof d.roleId === "number")
                    m.roleId = d.roleId;
                else if (typeof d.roleId === "object")
                    m.roleId = new $util.LongBits(d.roleId.low >>> 0, d.roleId.high >>> 0).toNumber(true);
            }
            if (d.code != null) {
                m.code = d.code >>> 0;
            }
            return m;
        };

        login_choose_role_s2c.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                if ($util.Long) {
                    var n = new $util.Long(0, 0, true);
                    d.roleId = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.roleId = o.longs === String ? "0" : 0;
                d.code = 0;
            }
            if (m.roleId != null && m.hasOwnProperty("roleId")) {
                if (typeof m.roleId === "number")
                    d.roleId = o.longs === String ? String(m.roleId) : m.roleId;
                else
                    d.roleId = o.longs === String ? $util.Long.prototype.toString.call(m.roleId) : o.longs === Number ? new $util.LongBits(m.roleId.low >>> 0, m.roleId.high >>> 0).toNumber(true) : m.roleId;
            }
            if (m.code != null && m.hasOwnProperty("code")) {
                d.code = m.code;
            }
            return d;
        };

        login_choose_role_s2c.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return login_choose_role_s2c;
    })();

    Game.p_key_value_name = (function() {

        function p_key_value_name(p) {
            if (p)
                for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
                    if (p[ks[i]] != null)
                        this[ks[i]] = p[ks[i]];
        }

        p_key_value_name.prototype.k = 0;
        p_key_value_name.prototype.v = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
        p_key_value_name.prototype.name = "";

        p_key_value_name.create = function create(properties) {
            return new p_key_value_name(properties);
        };

        p_key_value_name.encode = function encode(m, w) {
            if (!w)
                w = $Writer.create();
            if (m.k != null && Object.hasOwnProperty.call(m, "k"))
                w.uint32(8).int32(m.k);
            if (m.v != null && Object.hasOwnProperty.call(m, "v"))
                w.uint32(16).int64(m.v);
            if (m.name != null && Object.hasOwnProperty.call(m, "name"))
                w.uint32(26).string(m.name);
            return w;
        };

        p_key_value_name.decode = function decode(r, l) {
            if (!(r instanceof $Reader))
                r = $Reader.create(r);
            var c = l === undefined ? r.len : r.pos + l, m = new $root.Game.p_key_value_name();
            while (r.pos < c) {
                var t = r.uint32();
                switch (t >>> 3) {
                case 1:
                    m.k = r.int32();
                    break;
                case 2:
                    m.v = r.int64();
                    break;
                case 3:
                    m.name = r.string();
                    break;
                default:
                    r.skipType(t & 7);
                    break;
                }
            }
            return m;
        };

        p_key_value_name.fromObject = function fromObject(d) {
            if (d instanceof $root.Game.p_key_value_name)
                return d;
            var m = new $root.Game.p_key_value_name();
            if (d.k != null) {
                m.k = d.k | 0;
            }
            if (d.v != null) {
                if ($util.Long)
                    (m.v = $util.Long.fromValue(d.v)).unsigned = false;
                else if (typeof d.v === "string")
                    m.v = parseInt(d.v, 10);
                else if (typeof d.v === "number")
                    m.v = d.v;
                else if (typeof d.v === "object")
                    m.v = new $util.LongBits(d.v.low >>> 0, d.v.high >>> 0).toNumber();
            }
            if (d.name != null) {
                m.name = String(d.name);
            }
            return m;
        };

        p_key_value_name.toObject = function toObject(m, o) {
            if (!o)
                o = {};
            var d = {};
            if (o.defaults) {
                d.k = 0;
                if ($util.Long) {
                    var n = new $util.Long(0, 0, false);
                    d.v = o.longs === String ? n.toString() : o.longs === Number ? n.toNumber() : n;
                } else
                    d.v = o.longs === String ? "0" : 0;
                d.name = "";
            }
            if (m.k != null && m.hasOwnProperty("k")) {
                d.k = m.k;
            }
            if (m.v != null && m.hasOwnProperty("v")) {
                if (typeof m.v === "number")
                    d.v = o.longs === String ? String(m.v) : m.v;
                else
                    d.v = o.longs === String ? $util.Long.prototype.toString.call(m.v) : o.longs === Number ? new $util.LongBits(m.v.low >>> 0, m.v.high >>> 0).toNumber() : m.v;
            }
            if (m.name != null && m.hasOwnProperty("name")) {
                d.name = m.name;
            }
            return d;
        };

        p_key_value_name.prototype.toJSON = function toJSON() {
            return this.constructor.toObject(this, $protobuf.default.util.toJSONOptions);
        };

        return p_key_value_name;
    })();

    return Game;
})();

export { $root as default };
